#region Developer's comment header
/* aspnet_WebEvent_Events.cs
 * 
 * author:    DS2171
 * copyright: DS2171
 * 
 * history:   15/11/2010, DS2171: Created.
 *
 */
#endregion
#region Using directives

using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using System.Xml.Serialization;

using Chili.Opf3;
using Chili.Opf3.Relations;


#endregion

namespace DocManagerORM.Entità
{
	/// <summary>
	/// Persistent object for the "aspnet_WebEvent_Events" table.
	/// </summary>
	[Serializable]
	[Persistent("aspnet_WebEvent_Events")]
	public partial class aspnet_WebEvent_Events : IObjectNotification, ISelfContainingObject, INotifyPropertyChanged, Iaspnet_WebEvent_Events
	{
		#region Fields

		private string _eventId;
		private DateTime _eventTimeUtc;
		private DateTime _eventTime;
		private string _eventType;
		private decimal _eventSequence;
		private decimal _eventOccurrence;
		private int _eventCode;
		private int _eventDetailCode;
		private string _message;
		private string _applicationPath;
		private string _applicationVirtualPath;
		private string _machineName;
		private string _requestUrl;
		private string _exceptionType;
		private string _details;

		#endregion

		#region Properties

		/// <summary>
		/// Returns the identifier of the persistent object. Mandatory.
		/// </summary>
		[Field("EventId", AllowDBNull = false, Identifier = true)]
		public string EventId
		{
			get 
			{ 
				return _eventId; 
			}
			set 
			{
				if (value == null)
					throw new ArgumentNullException("value", "Value is null.");
				if (value != null && value.Length > 32)
					throw new ArgumentException("Value length must be between 0 and 32 characters.");

				_eventId = value;

				OnRowChanged("EventId");
			}
		}

		/// <summary>
		/// This property is mapped to the "EventTimeUtc" field.  Mandatory.
		/// Storage comment: .
		/// </summary>
		[Field("EventTimeUtc", AllowDBNull = false)]
		public DateTime EventTimeUtc
		{
			get 
			{ 
				return _eventTimeUtc; 
			}
			set 
			{
				_eventTimeUtc = value;

				OnRowChanged("EventTimeUtc");
			}
		}

		/// <summary>
		/// This property is mapped to the "EventTime" field.  Mandatory.
		/// Storage comment: .
		/// </summary>
		[Field("EventTime", AllowDBNull = false)]
		public DateTime EventTime
		{
			get 
			{ 
				return _eventTime; 
			}
			set 
			{
				_eventTime = value;

				OnRowChanged("EventTime");
			}
		}

		/// <summary>
		/// This property is mapped to the "EventType" field. Length must be between 0 and 256 characters. Mandatory.
		/// Storage comment: .
		/// </summary>
		[Field("EventType", AllowDBNull = false)]
		public string EventType
		{
			get 
			{ 
				return _eventType; 
			}
			set 
			{
				if (value == null)
					throw new ArgumentNullException("value", "Value is null.");
				if (value != null && value.Length > 256)
					throw new ArgumentException("Value length must be between 0 and 256 characters.");

				_eventType = value;

				OnRowChanged("EventType");
			}
		}

		/// <summary>
		/// This property is mapped to the "EventSequence" field.  Mandatory.
		/// Storage comment: .
		/// </summary>
		[Field("EventSequence", AllowDBNull = false)]
		public decimal EventSequence
		{
			get 
			{ 
				return _eventSequence; 
			}
			set 
			{
				_eventSequence = value;

				OnRowChanged("EventSequence");
			}
		}

		/// <summary>
		/// This property is mapped to the "EventOccurrence" field.  Mandatory.
		/// Storage comment: .
		/// </summary>
		[Field("EventOccurrence", AllowDBNull = false)]
		public decimal EventOccurrence
		{
			get 
			{ 
				return _eventOccurrence; 
			}
			set 
			{
				_eventOccurrence = value;

				OnRowChanged("EventOccurrence");
			}
		}

		/// <summary>
		/// This property is mapped to the "EventCode" field.  Mandatory.
		/// Storage comment: .
		/// </summary>
		[Field("EventCode", AllowDBNull = false)]
		public int EventCode
		{
			get 
			{ 
				return _eventCode; 
			}
			set 
			{
				_eventCode = value;

				OnRowChanged("EventCode");
			}
		}

		/// <summary>
		/// This property is mapped to the "EventDetailCode" field.  Mandatory.
		/// Storage comment: .
		/// </summary>
		[Field("EventDetailCode", AllowDBNull = false)]
		public int EventDetailCode
		{
			get 
			{ 
				return _eventDetailCode; 
			}
			set 
			{
				_eventDetailCode = value;

				OnRowChanged("EventDetailCode");
			}
		}

		/// <summary>
		/// This property is mapped to the "Message" field. Length must be between 0 and 1024 characters. 
		/// Storage comment: .
		/// </summary>
		[Field("Message")]
		public string Message
		{
			get 
			{ 
				return _message; 
			}
			set 
			{
				if (value != null && value.Length > 1024)
					throw new ArgumentException("Value length must be between 0 and 1024 characters.");

				_message = value;

				OnRowChanged("Message");
			}
		}

		/// <summary>
		/// This property is mapped to the "ApplicationPath" field. Length must be between 0 and 256 characters. 
		/// Storage comment: .
		/// </summary>
		[Field("ApplicationPath")]
		public string ApplicationPath
		{
			get 
			{ 
				return _applicationPath; 
			}
			set 
			{
				if (value != null && value.Length > 256)
					throw new ArgumentException("Value length must be between 0 and 256 characters.");

				_applicationPath = value;

				OnRowChanged("ApplicationPath");
			}
		}

		/// <summary>
		/// This property is mapped to the "ApplicationVirtualPath" field. Length must be between 0 and 256 characters. 
		/// Storage comment: .
		/// </summary>
		[Field("ApplicationVirtualPath")]
		public string ApplicationVirtualPath
		{
			get 
			{ 
				return _applicationVirtualPath; 
			}
			set 
			{
				if (value != null && value.Length > 256)
					throw new ArgumentException("Value length must be between 0 and 256 characters.");

				_applicationVirtualPath = value;

				OnRowChanged("ApplicationVirtualPath");
			}
		}

		/// <summary>
		/// This property is mapped to the "MachineName" field. Length must be between 0 and 256 characters. Mandatory.
		/// Storage comment: .
		/// </summary>
		[Field("MachineName", AllowDBNull = false)]
		public string MachineName
		{
			get 
			{ 
				return _machineName; 
			}
			set 
			{
				if (value == null)
					throw new ArgumentNullException("value", "Value is null.");
				if (value != null && value.Length > 256)
					throw new ArgumentException("Value length must be between 0 and 256 characters.");

				_machineName = value;

				OnRowChanged("MachineName");
			}
		}

		/// <summary>
		/// This property is mapped to the "RequestUrl" field. Length must be between 0 and 1024 characters. 
		/// Storage comment: .
		/// </summary>
		[Field("RequestUrl")]
		public string RequestUrl
		{
			get 
			{ 
				return _requestUrl; 
			}
			set 
			{
				if (value != null && value.Length > 1024)
					throw new ArgumentException("Value length must be between 0 and 1024 characters.");

				_requestUrl = value;

				OnRowChanged("RequestUrl");
			}
		}

		/// <summary>
		/// This property is mapped to the "ExceptionType" field. Length must be between 0 and 256 characters. 
		/// Storage comment: .
		/// </summary>
		[Field("ExceptionType")]
		public string ExceptionType
		{
			get 
			{ 
				return _exceptionType; 
			}
			set 
			{
				if (value != null && value.Length > 256)
					throw new ArgumentException("Value length must be between 0 and 256 characters.");

				_exceptionType = value;

				OnRowChanged("ExceptionType");
			}
		}

		/// <summary>
		/// This property is mapped to the "Details" field. Length must be between 0 and 1073741823 characters. 
		/// Storage comment: .
		/// </summary>
		[Field("Details")]
		public string Details
		{
			get 
			{ 
				return _details; 
			}
			set 
			{
				if (value != null && value.Length > 1073741823)
					throw new ArgumentException("Value length must be between 0 and 1073741823 characters.");

				_details = value;

				OnRowChanged("Details");
			}
		}

		#endregion

		#region IObjectNotification Members

		/// <summary>
		/// Invoked by the framework before the persistent object is populated.
		/// </summary>
		/// <param name="e">
		/// Contain information about the state of the persistent object and the
		/// <see cref="Opf3.ObjectContext">ObjectContext</see> of the current operation.
		/// </param>
		void IObjectNotification.OnBeforePopulated(ObjectNotificationEventArgs e)
		{
			// Add code here, if required. Leave empty if the event is not required.
		}

		/// <summary>
		/// Invoked by the framework after the object is populated.
		/// </summary>
		/// <param name="e">
		/// Contain information about the state of the persistent object and the
		/// <see cref="Opf3.ObjectContext">ObjectContext</see> of the current operation.
		/// </param>
		void IObjectNotification.OnAfterPopulated(ObjectNotificationEventArgs e)
		{
			// Add code here, if required. Leave empty if the event is not required.
		}

		/// <summary>
		/// Invoked by the framework before the object is inserted.
		/// </summary>
		/// <param name="e">
		/// Contain information about the state of the persistent object and the
		/// <see cref="Opf3.ObjectContext">ObjectContext</see> of the current operation.
		/// </param>
		void IObjectNotification.OnBeforeInsert(ObjectNotificationEventArgs e)
		{
			// Add code here, if required. Leave empty if the event is not required.
		}

		/// <summary>
		/// Invoked by the framework after the object is inserted.
		/// </summary>
		/// <param name="e">
		/// Contain information about the state of the persistent object and the
		/// <see cref="Opf3.ObjectContext">ObjectContext</see> of the current operation.
		/// </param>
		void IObjectNotification.OnAfterInsert(ObjectNotificationEventArgs e)
		{
			// Add code here, if required. Leave empty if the event is not required.
		}

		/// <summary>
		/// Invoked by the framework before the object is updated.
		/// </summary>
		/// <param name="e">
		/// Contain information about the state of the persistent object and the
		/// <see cref="Opf3.ObjectContext">ObjectContext</see> of the current operation.
		/// </param>
		void IObjectNotification.OnBeforeUpdate(ObjectNotificationEventArgs e)
		{
			// Add code here, if required. Leave empty if the event is not required.
		}

		/// <summary>
		/// Invoked by the framework after the object is updated.
		/// </summary>
		/// <param name="e">
		/// Contain information about the state of the persistent object and the
		/// <see cref="Opf3.ObjectContext">ObjectContext</see> of the current operation.
		/// </param>
		void IObjectNotification.OnAfterUpdate(ObjectNotificationEventArgs e)
		{
			// Add code here, if required. Leave empty if the event is not required.
		}

		/// <summary>
		/// Invoked by the framework before the object is deleted.
		/// </summary>
		/// <param name="e">
		/// Contain information about the state of the persistent object and the
		/// <see cref="Opf3.ObjectContext">ObjectContext</see> of the current operation.
		/// </param>
		void IObjectNotification.OnBeforeDelete(ObjectNotificationEventArgs e)
		{
			// Add code here, if required. Leave empty if the event is not required.
		}

		/// <summary>
		/// Invoked by the framework after the object is deleted.
		/// </summary>
		/// <param name="e">
		/// Contain information about the state of the persistent object and the
		/// <see cref="Opf3.ObjectContext">ObjectContext</see> of the current operation.
		/// </param>
		void IObjectNotification.OnAfterDelete(ObjectNotificationEventArgs e)
		{
			// Add code here, if required. Leave empty if the event is not required.
		}

		/// <summary>
		/// Invoked by the framework after the object has been marked deleted.
		/// </summary>
		/// <param name="e">
		/// Contain information about the state of the persistent object and the
		/// <see cref="Opf3.ObjectContext">ObjectContext</see> of the current operation.
		/// </param>
		void IObjectNotification.OnBeforeMarkDeleted(ObjectNotificationEventArgs e)
		{
			// Add code here, if required. Leave empty if the event is not required.
		}

		/// <summary>
		/// Invoked by the framework after the object has been marked deleted.
		/// </summary>
		/// <param name="e">
		/// Contain information about the state of the persistent object and the
		/// <see cref="Opf3.ObjectContext">ObjectContext</see> of the current operation.
		/// </param>
		void IObjectNotification.OnAfterMarkDeleted(ObjectNotificationEventArgs e)
		{
			// Add code here, if required. Leave empty if the event is not required.
		}

		#endregion

		#region ISelfContainingObject Members

		private ObjectInfo _objectInfo = null;

		/// <summary>
		/// Returns the <see cref="Opf3.ObjectInfo">ObjectInfo</see> object that contains all
		/// information required to make the persistent object
		/// <see cref="Opf3.ObjectContext">independent from any ObjectContext</see>.
		/// </summary>
		/// <value>
		/// 	<see cref="Opf3.ObjectInfo">ObjectInfo</see> object that holds the status
		/// information of the persistent object.
		/// </value>
		ObjectInfo ISelfContainingObject.ObjectInfo
		{
			get { return _objectInfo; }
			set { _objectInfo = value; }
		}

		#endregion

		#region INotifyPropertyChanged Members

		/// <summary>
		/// Invokes the "PropertyChanged" event if a property has been changed and
		/// somebody subscribed the event.
		/// </summary>
		private void OnRowChanged(string propertyName)
		{
			if (PropertyChanged != null)
				PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
		}

		/// <summary>
		/// Event is fired if a property of the persistent changed.
		/// </summary>
		public event PropertyChangedEventHandler PropertyChanged;

		#endregion
	}
}
